package cn.edu.wfu.libautobook.service.impl;

import cn.edu.wfu.libautobook.bean.Schedule;
import cn.edu.wfu.libautobook.mapper.ScheduleMapper;
import cn.edu.wfu.libautobook.service.ScheduleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ScheduleServiceImpl implements ScheduleService {
    private final ScheduleMapper scheduleMapper;

    @Autowired
    ScheduleServiceImpl(ScheduleMapper scheduleMapper) {
        this.scheduleMapper = scheduleMapper;
    }

    @Override
    public Schedule getScheduleBySid(Integer sid) {
        return scheduleMapper.getScheduleBySid(sid);
    }

    @Override
    public List<Schedule> getScheduleListByUid(Integer uid) {
        return scheduleMapper.getScheduleListByUid(uid);
    }

    @Override
    public Integer insertSchedule(Schedule schedule) {
        return scheduleMapper.insert(schedule);
    }

    @Override
    public Integer updateSchedule(Schedule schedule) {
        return scheduleMapper.updateById(schedule);
    }


}
